<?php

class Control_Model_Form_SubPage extends Zend_Form
{
    public function __construct($options = null)
    {
        parent::__construct($options);
        $this->setName('About');

        $id = new Zend_Form_Element_Hidden('id');
        $id->addFilter('Int');

        $title = new Zend_Form_Element_Text('title');
        $title->setLabel('Page title:')
            ->setRequired(true)
            ->addFilter('StripTags')
            ->addFilter('StringTrim')
            ->addValidator('NotEmpty')
            ->setAttrib('size', 50);

        $name = new Zend_Form_Element_Text('name');
        $name->setLabel('Page name:')
            ->setRequired(true)
            ->addFilter('StripTags')
            ->addFilter('StringTrim')
            ->addValidator('NotEmpty')
            ->setAttrib('size', 50);

        $about_page = new Zend_Form_Element_Text('about_page');
        $about_page->setLabel('Short about this page:')
            ->setRequired(true)
            ->addFilter('StripTags')
            ->addFilter('StringTrim')
            ->addValidator('NotEmpty')
            ->setAttrib('size', 50);

        $meta_desc = new Zend_Form_Element_Text('meta_desc');
        $meta_desc->setLabel('<Meta Desscription keys>:')
            ->setRequired(true)
            ->addFilter('StripTags')
            ->addFilter('StringTrim')
            ->addValidator('NotEmpty')
            ->setAttrib('size', 50);

        $meta_keyw = new Zend_Form_Element_Text('meta_keyw');
        $meta_keyw->setLabel('<Meta keywords>:')
            ->setRequired(true)
            ->addFilter('StripTags')
            ->addFilter('StringTrim')
            ->addValidator('NotEmpty')
            ->setAttrib('size', 50);

        $block_first = new Zend_Form_Element_Textarea('block_first');
        $block_first->setLabel('Html edited block pre content:')
            ->setAttrib('class', 'elrte');

        $foreach_first = new Zend_Form_Element_Textarea('foreach_first');
        $foreach_first->setLabel('Pre content block of cycle:')
            ->setAttrib('class', 'elrte');

        $foreach_last = new Zend_Form_Element_Textarea('foreach_last');
        $foreach_last->setLabel('Post content block of cycle:')
            ->setAttrib('class', 'elrte');

        $block_second = new Zend_Form_Element_Textarea('block_second');
        $block_second->setLabel('Html edited block post content:')
            ->setAttrib('class', 'elrte');;

        $showin_about = new Zend_Form_Element_Checkbox('showin_about');
        $showin_about->setLabel('Show this in menu about page ')
                ->setCheckedValue('1')
                ->setUncheckedValue('0')
                ->setValue('0');

        $showin_services = new Zend_Form_Element_Checkbox('showin_services');
        $showin_services->setLabel('Show this in menu services page')
                ->setCheckedValue('1')
                ->setUncheckedValue('0')
                ->setValue('0');

        $showin_news = new Zend_Form_Element_Checkbox('showin_news');
        $showin_news->setLabel('Show this in menu news page')
                ->setCheckedValue('1')
                ->setUncheckedValue('0')
                ->setValue('0');

        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id', 'submitbutton');

        $this->addElements(array($id, $title, $name, $about_page, $meta_desc, 
            $meta_keyw, $block_first, $foreach_first, $foreach_last, $block_second,
            $showin_about, $showin_services, $showin_news, $submit));
    }
}